<?php
/**
 * Installer language selection page
 *
 * @copyright		The XOOPS project http://www.xoops.org/
 * @license			http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)
 * @package			installer
 * @since			2.0.18
 * @version			$Id: page_langselect.php 596 2006-06-30 03:14:03Z skalpa $
 *
 * @author			Haruki Setoyama  <haruki@planewave.org>
 * @author			Kazumi Ono <webmaster@myweb.ne.jp>
 * @author			Skalpa Keo <skalpa@xoops.org>
 * @author			dugris <dugris@frxoops.org>
**/

require_once 'common.inc.php';
if ( !defined('XOOPS_INSTALL') ) { die('XOOPS Custom Installation die'); }

$wizard->setPage( 'langselect' );

if ( $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['lang']) ) {
	$_SESSION['settings']['language'] = $lang = $_REQUEST['lang'];
	setcookie( 'xo_install_lang', $lang, null, null, null );

	$wizard->redirectToPage( '+1' );
	exit();
}

$_SESSION['settings'] = array();
$pageHasForm = true;
$title = LANGUAGE_SELECTION;
$content = '<select name="lang" size="10">';

$languages = getDirList( "./language/" );
foreach ( $languages as $lang ) {
	$sel = ( $lang == $wizard->language ) ? ' selected="selected"' : '';
	$content .= "<option value=\"$lang\"$sel>$lang</option>\n";
}
$content .= "</select>";

include 'install_tpl.php';

?>